package clas.ac.cn.common.controller;//import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController;
//
////package cn.aclas.controller;
////
////import cn.aclas.exception.NotFoundException;
////import com.alibaba.fastjson.JSON;
////import lombok.extern.slf4j.Slf4j;
////import org.springframework.beans.factory.annotation.Autowired;
////import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController;
////import org.springframework.http.HttpStatus;
////import org.springframework.http.ResponseEntity;
////import org.springframework.stereotype.Controller;
////import org.springframework.web.bind.annotation.RequestMapping;
////import org.springframework.web.bind.annotation.RequestMethod;
////import org.springframework.web.bind.annotation.ResponseBody;
////
////import javax.servlet.http.HttpServletRequest;
////import javax.servlet.http.HttpServletResponse;
////import java.util.Map;
////
////@Controller
////@Slf4j
//public class IErrorController {
//    private final BasicErrorController basicErrorController;
//
//    @Autowired
//    public IErrorController(BasicErrorController basicErrorController) {
//        this.basicErrorController = basicErrorController;
//    }
//
//    @RequestMapping(value = "/error", method = {RequestMethod.GET, RequestMethod.POST})
//    @ResponseBody
//    public Object error(HttpServletRequest request, HttpServletResponse response) throws NotFoundException {
//
//        ResponseEntity<Map<String, Object>> error = basicErrorController.error(request);
//        log.error(request.getRequestURI()+"统一异常处理-》ERROR:=>"+ JSON.toJSONString(error));
//        throw  new NotFoundException(request.getRequestURI(),error.getStatusCode().value());
//    }
//
//}
